﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Windows;
using AvalonDock.Layout;

namespace RazorSourceGenerator.ViewModel
{
    public class LayoutTemplateSelector : DataTemplateSelector
    {
        public DataTemplate ConfigViewTemplate
        {
            get;
            set;
        }

        public DataTemplate LogViewTemplate
        {
            get;
            set;
        }

        public override System.Windows.DataTemplate SelectTemplate(object item, System.Windows.DependencyObject container)
        {
            var itemAsLayoutContent = item as LayoutContent;

            if (item is ConfigViewModel)
                return ConfigViewTemplate;

            if (item is LogViewModel)
                return LogViewTemplate;

            return base.SelectTemplate(item, container);
        }
    }
}
